﻿/*
 * 
 *	C# object representation of row in 'researchRepo.researchTypes' table:
 *	
 *	Currently a simple mapping of all table columns to equivalent properties,
 *	though the class might be expanded to track appropriate relationships with other tables.
 * 
 */

namespace ResearchRepository.Models
{
	public class RRResearchType
	{
		public RRResearchType(int rID, int superRID, string rName)
		{
			ResId = rID;
			SuperResId = superRID;
			ResName = rName;
		}
		public RRResearchType(RRResearchType source)
			:this(source.ResId,
					source.SuperResId,
					source.ResName)
		{}
		public RRResearchType(System.Data.IDataRecord source)
			:this((int) source["resID"],
					(int) source["superResID"],
					(string) source["resName"])
		{}

		// named alias for constructor, provides handle to simulate a function pointer to constructor
		public static RRResearchType construct(System.Data.IDataRecord source)
		{
			return new RRResearchType(source);
		}

		public int ResId { get; set; }
		public int SuperResId { get; set; }
		public string ResName { get; set; }
	}
}